import React from "react";
import {Router, Route, hashHistory, IndexRedirect} from "react-router";
import Page from "./components/Page";
import Login from "./components/pages/Login"; // 登录页
import Dashboard from "./components/dashboard/Dashboard";  // 首页
import Admins from "./components/admin/Admins"; // 系统管理员
import AdminsAdd from "./components/admin/AdminsAdd"; // 添加管理员
import AdminsEdit from "./components/admin/AdminsEdit"; // 
 
import BannerEdit from "./components/banner/BannerEdit.jsx"; // 轮播图

import Packages from "./components/pkg/Packages.jsx"; // 套餐管理
import PackageEdit from "./components/pkg/PackageEdit.jsx";

import Courts from "./components/court/Courts.jsx"; // 城市工地
import CourtEdit from "./components/court/CourtEdit.jsx";

import Samples from "./components/sample/Samples.jsx"; // 案例管理
import SampleEdit from "./components/sample/SampleEdit.jsx";

import Applys from "./components/apply/Applys.jsx"; // 预约订单
import ApplyEdit from "./components/apply/ApplyEdit.jsx"; 

import Signeds from "./components/signed/Signeds.jsx"; // 签约订单
import SignedEdit from "./components/signed/SignedEdit.jsx";

import Staffs from "./components/staffMange/Staffs.jsx"; // 员工管理
import StaffEdit from "./components/staffMange/StaffEdit.jsx";
import Entering from "./components/staffMange/entering.jsx"; // 录入员工

import Home from "./Home";

const routes = (
    <Router history={hashHistory}>
        <Route path={"/"} components={Page}>
            <IndexRedirect to="/app"/>
            <Route path={"app"} component={Home}>
                <Route path={"admin"}>
                    <Route path={"admins"} component={Admins}/>
                    <Route path={"edit/:id"} component={AdminsEdit}/>
                </Route>
                <Route path={'banner'}>
                    <Route path={'edit'} component={BannerEdit}/>
                </Route>
                <Route path={"pkg"}>
                    <Route path={"packages"} component={Packages}/>
                    <Route path={"edit/:id"} component={PackageEdit}/>
                </Route>
                <Route path={"apply"}>
                    <Route path={"applys"} component={Applys}/>
                    <Route path={"edit/:id"} component={ApplyEdit}/>
                </Route>
                <Route path={"signed"}>
                    <Route path={"signeds"} component={Signeds}/>
                    <Route path={"edit/:id"} component={SignedEdit}/>
                </Route>
                <Route path={"court"}>
                    <Route path={"courts"} component={Courts}/>
                    <Route path={"edit/:id"} component={CourtEdit}/>
                </Route>
                <Route path={"sample"}>
                    <Route path={"samples"} component={Samples}/>
                    <Route path={"edit/:id"} component={SampleEdit}/>
                </Route>
                <Route path={"staffMange"}>
                    <Route path={"staffs"} component={Staffs}/>
                    <Route path={"edit/:id"} component={StaffEdit}/>
                    <Route path={"entering"} component={Entering}/>                    
                </Route>
                <Route path={"dashboard/index"} component={Dashboard}/>
            </Route>
            <Route path={"login"} components={Login}/>
            {/*<Route path={'404'} component={NotFound}/>*/}
        </Route>
    </Router>
);
export default routes;
